home *** CD-ROM | disk | FTP | other *** search
- Path: interramp.com!usenet
- From: Barnett@interramp.com (Barnett E. Kurtz)
- Newsgroups: comp.lang.c,comp.lang.c++,comp.os.msdos.programmer
- Subject: Re: Device Drivers
- Date: Thu, 01 Feb 1996 01:49:51 GMT
- Organization: EntroData, Inc.
- Message-ID: <4ep6ae$2o6@usenet7.interramp.com>
- References: <4em26p$el1@canopus.cc.umanitoba.ca>
- Reply-To: Barnett@interramp.com
- NNTP-Posting-Host: ip149.philadelphia.pa.interramp.com
- X-Newsreader: Forte Free Agent 1.0.82
-
- Nathan,
-
- This is probably not the best place to ask this type of question.
- comp.os.ms-dos.programmer would be better. It is very OS dependent.
-
- However, you might try using the dynamic overlay loading feature of
- BCC. Place your asm code in separate modules. TASM will compile them
- when you do your build. Reference them from main and let main() do the
- driving, i.e. BCC will link your ASM, etc and build the overlays for
- you. As a byproduct the mini-drivers will now demand load from disk or
- expanded memory (if available) as needed. Also, consider doing your C
- code and build without the need for the C runtime. It has been a few
- years, but as I recall it is pretty large. If you are already doing
- most of the work in ASM it should not be to difficult to do.
- -
- Good Luck!
- barnett@interramp.com
- _
- natewild@mbnet.mb.ca (Nathan T. Wild) wrote:
-
- >I would like to be able to make device drivers in C. I writing an
- >application which uses loadable modules for some of it's functions.
- >
- >Currently these functions are written in Assembly language. The
- >assembled executable code is stripped of it's EXE header and the
- >contents is written directly to memory... Then a function pointer is
- >set to point to this code.
- >
- >This works... But how can I go about generating these executable
- >"driver" files in C, rather than assembly language? In order to link my
- >C code, I need a main()?
- >
- >Can this be done? Can somebody explain how to do it?
- >
- >I actually want a C++ class to load these modules in from it's
- >constructor, but I am currently stuck writing everything in assembly
- >language?
- >
- >Does anyone know how to translate the object-code generated by the C
- >compiler into raw executable code for loading as a device driver in this
- >manner?
- >
- >I am using DOS and Borland C++, but that shouldn't really matter...
- >
- >
- >
- >Please respond via email, as I do not have live access to this group.
- >If I get a collection of good responses, I will post a follow-up to
- >comp.os.msdos.programmer, comp.lang.c and comp.lang.c++
-
- -
- barnett@interramp.com
- -
-
-